{{#extends @html/layouts/layout-standart.html}}

{{:title}}Список пользователей сообщества{{/:title}}

{{:init}}
	{{@community.html:init}}
	{{!connect "jquery.js"}}
	{{!connect "screen/content-users.css" media="screen" charset="utf-8"}}
	{{!connect "screen/widgets-default.css" media="screen" charset="utf-8"}}
		{{?actions.community_edit.is_allowed == 1}}
	{{!connect "cpaint2.inc.js"}}
	{{!connect "community/members.js"}}
	{{!connect "community/membersView.js"}}
	<a href="{{/}}{{community.url}}/members/ajax" id="member_submit_url" class="hidden-"></a>
		{{/?}}
{{/:init}}

{{:content_class}}content-users{{/:content_class}}

{{:layout_main}}
	<!--{{@:users_list data=wg_members.content}}
		{{:users_list}}
		-->
	<h1 class="title-">Список участников</h1>
	<ul class="listmenu-">
		<!-- меню "сортировать по..." -->
		{{!for menu do=@:menu_item}}
		{{:menu_item *is_current}}
		<li class="selected-">{{@:menu_item_title}}</li>
		{{/:menu_item}}
		{{:menu_item}}
		<li><a href="{{/}}{{community.url}}/members?sort={{*action}}">{{@:menu_item_title}}</a></li>
		{{/:menu_item}}
		{{:menu_item_title *action == 'date'}}По дате регистрации{{/:menu_item_title}}
		{{:menu_item_title *action == 'name'}}По алфавиту{{/:menu_item_title}}
		{{:menu_item_title *action == 'activity'}}По активности{{/:menu_item_title}}
	</ul>
	<div class="users-"><table id="userstable">
		<thead>
			<tr>
				<th class="name-">Имя пользователя<span>OpenId</span></th>
				<th class="status-">Статус в сообществе</th>
			</tr>
		</thead>
		<tbody>
			{{!for items do=@:member}}
			{{:member}}
			<tr class="row-" id="usersrow_2" >
				<td class="name-">
					<a href="{{/}}{{community.url}}/members/{{*oid}}" class="user-">
					    <img src="{{?*avatar}}{{/}}{{*avatar | link_to 'imagestorage' 'sm1'}}{{?:}}{{images}}avatar-48x48.png{{/?}}" alt="" class="avatar-" />{{*fullname}}
					</a>
					<span class="openid-">{{*openid_url}}</span>
				</td>
				<td class="status-">
					<span class="current-">{{@:rt title=*role_title}}</span>
					{{?actions.community_edit.is_allowed == 1}}
					<input class="userid-" type="hidden" value="{{*oid}}"/>
					<select class="selector-">
						{{!for roles as="role" do=@:role}}
						{{:role}}
						<option value="{{role.oid}}" {{?*role_oid == role.oid}}selected="selected"{{/?}}>{{@:rt title=role.title}}</option>
						{{/:role}}
						{{:rt title=='Moderator'}}модератор{{/:rt}}
						{{:rt title=='CommunityMember'}}член сообщества{{/:rt}}
						{{:rt}}{{title}}{{/:rt}}
					</select>
					<span class="delete-"><a href="#">Выгнать из сообщества</a></span>
					{{/?}}
				</td>
			</tr>
			{{/:member}}
		</tbody>
	</table></div>

	<ul class="pagenavigation-">
		{{?page.prev}}
		<li><a href="{{prev_url |safe}}">←Следующая страница</a></li>
		{{?:}}
		<li>←Следующая страница</li>
		{{/?}}
		{{?page.next}}
		<li><a href="{{next_url |safe}}">Предыдущая страница→</a></li>
		{{?:}}
		<li>Предыдущая страница→</li>
		{{/?}}
	</ul>
<!--	{{/:users_list}} -->
{{/:layout_main}}
